#pragma once

#include <iostream>
#include <memory>

#include "Usage.hpp"
#include "HttpServer.hpp"

// http一般有自己的web根目录
#define ROOT "./wwwroot" // ./wwwroot/index.html
// 若客户都安只请求了一个'/'，返回默认首页
#define HOMEPAGE "index.html"

void HandlerHttpRequest(int sockfd)
{
    // 1. 读取请求
    char buffer[1024];
    ssize_t s = recv(sockfd, buffer, sizeof(buffer)-1, 0);
    if(s > 0)
    {
        buffer[s] = 0;
    }

    std::vector<std::string> vline;

}

int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(0);
    }

    //std::unique_ptr<HttpServer> http_server(new HttpServer(argv[1]));
    // http_server->Start();
    return 0;
}